<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "d_try.try_rec".
 *
 * @property string $try_recommend_id
 * @property integer $display_position
 * @property integer $status
 * @property integer $product1
 * @property integer $product2
 * @property integer $product3
 * @property string $pic1
 * @property string $pic2
 * @property string $pic3
 * @property string $recommend_time
 * @property string $add_user
 * @property string $add_time
 */
class TryRec extends \yii\db\ActiveRecord
{
    public static $STATUS = [0=>'不显示', 1=>'显示'];
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.try_rec';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['display_position', 'status', 'product1', 'product2', 'product3'], 'integer'],
            [['product1', 'product2', 'product3', 'recommend_time'], 'required'],
            [['recommend_time', 'add_time'], 'safe'],
            [['pic1'], 'string', 'max' => 255],
            [['add_user'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'try_recommend_id' => 'Try Recommend ID',
            'display_position' => '展示位',
            'status' => '是否显示',
            'product1' => '货号1',
            'product2' => '货号2',
            'product3' => '货号3',
            'pic1' => '图片',
            'recommend_time' => '推荐时间',
            'add_user' => 'Add User',
            'add_time' => 'Add Time',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\TryRecQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\TryRecQuery(get_called_class());
    }
}
